package com.fulu.game.bi.mysql.playadmin.channel;

import com.fulu.game.bi.entity.bo.channel.LabelAndKeywordsBO;
import com.fulu.game.bi.entity.bo.channel.LabelBO;
import com.fulu.game.bi.entity.po.auth.BiUser;
import com.fulu.game.bi.entity.po.channel.Label;
import com.fulu.game.bi.entity.vo.channel.label.LabelQueryVO;
import com.fulu.game.bi.mysql.bi.ICommonDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LabelDao extends ICommonDao<BiUser, Integer> {
    /**
     * 修改非空字段
     */
    int updateSelective(Label label);

    /**
     * 新增标签
     */
    int insert(Label label);

    /**
     * 列表查询
     */
    List<Label> list(LabelQueryVO vo);

    /**
     * 根据keyWord获取到标签ID
     */
    List<Integer> findLabelIdByKeywordsLike(String keyword);


    List<Label> findByParameter(LabelBO labelBO);

    List<LabelAndKeywordsBO> findLabelAndKeywordsBOByKeywords(@Param("keywordsList")List<String> keywordsList);

    List<LabelAndKeywordsBO> findLabelAndKeywordsBOByKeywordsAndIdNot(@Param("keywordsList")List<String> keywordsList,@Param("notId") Integer notId);

    Integer countByName(@Param("name")String name);

    List<String> findNameByNameLike(@Param("likeName")String likeName);

    /**
     * 根据分组获取标签
     */
    List<Label> findByIds(@Param("ids") List<Integer> ids);
}
